package com.mingqijia.gassafety.shared.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * 数据表种类代号
 */
public enum UploadCodeEnum {
    EXPORT_1("设备信息dtu", "UPLOAD0001"),
    EXPORT_2("客户信息consumer", "UPLOAD0002"),
    EXPORT_3("MBP客户批量导入", "UPLOAD0003"),
    EXPORT_4("设备信息批量导入删除", "UPLOAD0004");


    private String name;

    private String code;

    private UploadCodeEnum(String name, String code) {
        this.name = name;
        this.code = code;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public String getCode() {
        return this.code;
    }


    public static UploadCodeEnum getUploadCode(String exportCode) {
        if (StringUtils.isBlank(exportCode)) {
            return null;
        }
        for (UploadCodeEnum code : UploadCodeEnum.values()) {
            if (code.code.equalsIgnoreCase(exportCode)) {
                return code;
            }
        }
        return null;
    }
}
